package com.hqj.dao;

import com.hqj.entity.Homes;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface HomesDao extends BaseDao<Homes>{

    @Select("select jzjg,count(id) num,(select count(id) from t_homes) con from t_homes GROUP BY jzjg")
    public List<Map<String,Object>> findBasePie();

    @Select("select (select name from t_area a where a.id = xq_id) xq_name from t_homes where 1=1 group by xq_id order by xq_id")
    public List<String> findAreasGroup();

    @Select("select status from t_homes group by status")
    public List<String> findStatusGroup();

    @Select("select status,count(id) con," +
            "(select name from t_area a where a.id = xq_id) xqName " +
            "from t_homes where 1=1  group by status,xq_id order by xq_id")
    public List<Map<String,Object>> findAreaGroupStatusAndID();

}
